package com.zhao.dota.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhao.dota.model.Quotation;
import com.zhao.dota.model.Round;
import com.zhao.dota.vo.QuotationVo;
import com.zhao.dota.vo.RollVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface QuotationService extends IService<Quotation> {

    Quotation save(Integer leagueId, Quotation quotation);

    @Transactional
    Quotation otherQuotation(Integer leagueId, Quotation quotation);

    List<QuotationVo> findByRoundId(Integer roundId);

    /**
     * 结算出价之后玩家获得的英雄
     * @param quoting round
     * @return 是否有相同出价
     */
    boolean calUserHeroes(Round quoting);

    int refund(Quotation quotation);

    void sendRollWebSocket(Integer roundId);

    void systemRoll(Integer roundId);

    int roll(Integer roundId, Integer heroId);

    List<RollVo> needRolls(Integer leagueId);

    boolean cancel(Integer id);
}
